package org.jivesoftware.smack.proxy;

import javax.net.SocketFactory;

public class ProxyInfo
{
  private String proxyAddress;
  private int proxyPort;
  private String proxyUsername;
  private String proxyPassword;
  private ProxyType proxyType;

  public ProxyInfo(ProxyType paramProxyType, String paramString1, int paramInt, String paramString2, String paramString3)
  {
    this.proxyType = paramProxyType;
    this.proxyAddress = paramString1;
    this.proxyPort = paramInt;
    this.proxyUsername = paramString2;
    this.proxyPassword = paramString3;
  }

  public static ProxyInfo forHttpProxy(String paramString1, int paramInt, String paramString2, String paramString3)
  {
    return new ProxyInfo(ProxyType.HTTP, paramString1, paramInt, paramString2, paramString3);
  }

  public static ProxyInfo forSocks4Proxy(String paramString1, int paramInt, String paramString2, String paramString3)
  {
    return new ProxyInfo(ProxyType.SOCKS4, paramString1, paramInt, paramString2, paramString3);
  }

  public static ProxyInfo forSocks5Proxy(String paramString1, int paramInt, String paramString2, String paramString3)
  {
    return new ProxyInfo(ProxyType.SOCKS5, paramString1, paramInt, paramString2, paramString3);
  }

  public static ProxyInfo forNoProxy()
  {
    return new ProxyInfo(ProxyType.NONE, null, 0, null, null);
  }

  public static ProxyInfo forDefaultProxy()
  {
    return new ProxyInfo(ProxyType.NONE, null, 0, null, null);
  }

  public ProxyType getProxyType()
  {
    return this.proxyType;
  }

  public String getProxyAddress()
  {
    return this.proxyAddress;
  }

  public int getProxyPort()
  {
    return this.proxyPort;
  }

  public String getProxyUsername()
  {
    return this.proxyUsername;
  }

  public String getProxyPassword()
  {
    return this.proxyPassword;
  }

  public SocketFactory getSocketFactory()
  {
    if (this.proxyType == ProxyType.NONE)
      return new DirectSocketFactory();
    if (this.proxyType == ProxyType.HTTP)
      return new HTTPProxySocketFactory(this);
    if (this.proxyType == ProxyType.SOCKS4)
      return new Socks4ProxySocketFactory(this);
    if (this.proxyType == ProxyType.SOCKS5)
      return new Socks5ProxySocketFactory(this);
    return null;
  }

  public static enum ProxyType
  {
    NONE, HTTP, SOCKS4, SOCKS5;
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smack.proxy.ProxyInfo
 * JD-Core Version:    0.6.1
 */